Linear Transformations
Linear transformations are the bread and butter of linear algebra. They are functions that map vectors to vectors in a way that preserves the structure of the vector space. In this section, we will explore the properties of linear transformations and how they can be represented using matrices.
Table of Contents
Thinking about Transformations
For the purposes of this section, we will not consider the formal definition of a linear transformation, because that will hinder our understanding. Instead, we will approach this from a more intuitive perspective.
The term "linear transformation" has two parts: "linear" and "transformation". We will first focus on what a transformation is, and then we will discuss what it means for a transformation to be linear.
A transformation is essentially just a function; it takes an input and produces an output. These terms are used interchangeably in this context, but by convention, we use "transformation" here. The difference between a function that one would typically encounter and a linear transformation is that these transformations act on vectors.
A function can be notated like
Just like functions, transformations have various components that define them, such as their domain, codomain, and image. For the sake of simplicity, we won't delve into these details, but it's important to keep in mind that there is a formal underpinning to these concepts.
Visualizing a Transformation
One way to conceptualize a transformation is that they take a vector and move it to a different location in space.
Below is a visualization of a transformation that takes a vector
Doing this for multiple vectors will give us a sense of how the transformation behaves on the entire space:
Next, we can replace each vector with a point to make things clearer.
Sometimes, it's beneficial to visualize the transformation acting on not a set of vectors, but the grid itself:
What Makes a Transformation Linear?
There is a formal definition of what it means for a transformation to be linear based on two properties that it must satisfy (additivity and homogeneity). Graphically, these properties correspond to the transformation preserving the structure of the space.
Intuitively, a transformation is linear if it doesn't twist or distort the space. That is, every line remains a line after the transformation, and the origin remains fixed at
In the visualization below, the left side shows a linear transformation, and the right side shows a non-linear transformation.
Here's another example. Initially, this looks like a linear transformation, but it's not:
From this visualization, the lines remain lines and the origin remains fixed, so it seems like a linear transformation. However, this is just because we drew some lines, not all of them. If we draw a diagonal line, we can see that the transformation twists the line:
In order to account for all lines in the space, we need to add another condition: that the gridlines remain parallel and evenly spaced.
Putting everything together, we can say that:
A transformation
- Every line remains a line.
- The origin remains fixed at
. - The gridlines remain parallel and evenly spaced.
In linear algebra, we often restrict our attention to linear transformations because they are easier to work with and have nice properties that we can exploit. After all, linear transformations and linear algebra share the term "linear" for a reason.
Representing Linear Transformations
Recall that a linear transformation is a function that maps vectors to vectors in a way that preserves the structure of the vector space. We deduced that gridlines must remain parallel and evenly spaced for a transformation to be linear.
A consequence of this is that we can describe a linear transformation by specifying where it sends the basis vectors.
Consider a vector
When we transform the basis vectors
First, let's visualize the basis vectors
In our transformation,
Let's add our vector
Notice that before the transformation,
If we write it out mathematically, we have:
Essentially, when transforming a vector, we replace the basis vectors with their transformed counterparts and keep the coefficients the same.
In a more general case, suppose the vector is
Introducing The Matrix
To sum up the previous section, we can represent a linear transformation by specifying where it sends the basis vectors.
We looked at an example where
This matrix has two columns, one representing the transformed
If we were to apply this transformation to a vector
When we apply the transformation to a vector, we often place the matrix in front of the vector in a matrix-vector product:
Finally, let's generalize this process. Given a matrix
The last equation is the general form of a matrix-vector product. Let's write it again for emphasis:
Geometric Transformations
In the previous section, we discussed how linear transformations can be represented by matrices. Let's explore some common geometric transformations and how they can be represented using matrices.
Remember that the matrix
Scaling
A scaling transformation stretches or compresses the space along the axes.
For example, consider a scaling transformation that stretches the
Looking at where it takes the basis vectors, we have:
The visualization below shows how this transformation acts on the space:
In a more general case, a scaling transformation that stretches the
If any of the factors are negative, the space is reflected across the corresponding axis.
Rotation
A rotation transformation rotates the space by a certain angle.
For example, consider a rotation transformation that rotates the space by
This one is a bit trickier to write, so let's draw it out first.
The diagram below shows the basis vectors
Looking at where it takes the basis vectors, we have:
Notice that the rotated
Shearing
A shearing transformation skews the space along the axes. When this happens, one of the basis vectors remains fixed, and the other is shifted along the fixed vector.
For example, consider a shearing transformation that shifts the
A visualization of this transformation is shown below:
Looking at where it takes the basis vectors, we have:
More generally, a shearing transformation that shifts the
No Transformation (Identity Matrix)
Finally, let's consider a transformation that doesn't do anything.
In terms of the basis vectors, this transformation sends
This matrix has a special name: the identity matrix, and it is often denoted by
This can be generalized to higher dimensions by simply adding more rows and columns of
Summary and Next Steps
In this section, we introduced the fundamental concept of linear transformations and how they can be represented using matrices.
Here are the key points to remember:
-
A linear transformation is a function that maps vectors to vectors in a way that preserves the structure of the vector space.
-
Linear transformations have the visual property that every line remains a line, the origin remains fixed, and the gridlines remain parallel and evenly spaced.
-
Linear transformations can be represented by specifying where they send the basis vectors.
-
These specifications can be organized into a matrix, which can be used to transform vectors using matrix-vector multiplication:
-
Common geometric transformations like scaling, rotation, and shearing can be represented by specific matrices:
- Scaling:
- Rotation:
- Shearing:
- Identity:
- Scaling:
-
The identity matrix
represents a transformation that doesn't do anything.
In the next section, we will explore how linear transformations can be composed and inverted, which will allow us to build more complex transformations from simpler ones.